<?php
namespace app\common\model;

class Logistics extends Base
{
    protected $resultSetType = 'collection';

    /**
     * 查询所有物流公司
     * @return [type] [description]
     */
    public function getDatas($where=[],$field=''){
        return $this->where($where)->field($field)->select();
    }


    /**
     * 查询单个物流信息
     * @return [type] [description]
     */
    public function getOne($id='',$field=''){
        return $this->where(['id'=>$id])->field($field)->find();
    }

    /**
     * 查询单个物流名称
     * @return [type] [description]
     */
    public function getTitle($id=''){
        return $this->where(['id'=>$id])->value('title');
    }

    /**
     * 添加物流公司信息
     * @return [type] [description]
     */
    public function addOneData($data=[]){
        return $this->save($data);
    }

    /**
     * 删除物流公司信息
     * @return [type] [description]
     */
    public function deleteOneData($data=[]){
        return $this->where($data)->delete();
    }

    /**
     * 更新物流公司信息
     * @return [type] [description]
     */
    public function saveOneData($data=[],$id=''){
        return $this->save($data,['id' => $id]);
    }

}
